<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%languages}}".
 *
 * @property string $id ID主键
 * @property string $language 语言
 * @property string $table_name 表名
 * @property string $table_id 表id
 * @property string $table_field 表字段
 * @property string $content 翻译内容
 * @property string $created_time 创建时间
 * @property string $updated_time 修改时间
 */
class Languages extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%languages}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['table_id', 'created_time', 'updated_time'], 'integer'],
            [['content'], 'required', 'message'=>'翻译内容不能为空'],
            [['content'], 'string'],
            [['language'], 'string', 'max' => 10],
            [['table_name'], 'string', 'max' => 50],
            [['table_field'], 'string', 'max' => 32],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID主键'),
            'language' => Yii::t('app', '语言'),
            'table_name' => Yii::t('app', '表名'),
            'table_id' => Yii::t('app', '表id'),
            'table_field' => Yii::t('app', '表字段'),
            'content' => Yii::t('app', '翻译内容'),
            'created_time' => Yii::t('app', '创建时间'),
            'updated_time' => Yii::t('app', '修改时间'),
        ];
    }

}
